package org.loong.crypto.service.core.provider;

import javax.crypto.SecretKey;

import org.loong.crypto.common.exception.CryptoException;
import org.loong.crypto.core.algorithm.KeyAlgorithm;

/**
 * KeyGenerator.
 */
public interface KeyGenerator extends KeyGeneratorProvider {

    /**
     * Generated {@link SecretKey}, used only for symmetric encryption and summary algorithm key generation.
     * 
     * @param algorithm the algorithm
     * @param keySize the keySize
     * @return {@link SecretKey}
     * @throws CryptoException the {@link CryptoException}
     */
    SecretKey generateKey(KeyAlgorithm algorithm, int keySize) throws CryptoException;
}
